import config from "@/config"
import http from "@/utils/request"

export default {
  getBanner: {
    url: `${config.API_URL}/cms/banner/list`,
    name: "获取banner列表",
    get: async function(params){
      return await http.get(this.url,params)
    }
  },
  bannerDetail: {
    url: `${config.API_URL}/cms/banner/info/`,
    name: "获取banner详情",
    get: async function(params){
      return await http.get(this.url+params)
    }
  },
  bannerUpload: {
    url: `${config.API_URL}/cms/banner/save`,
    name: "上传banner",
    post: async function(data = {}){
      return await http.post(this.url,data)
    }
  },
  setStatus: {
    url: `${config.API_URL}/cms/banner/status`,
    name: "上下架",
    post: async function(data){
      return await http.post(this.url,data)
    }
  },
  fetchShortsList: {
    url: `${config.API_URL}/ms/cms/short/list`,
    name: "banner shorts 列表",
    get: async function(params) {
      return await http.get(this.url, params)
    }
  },
}